package com.hc.threadpool.controller;

import com.hc.threadpool.service.ThreadPoolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: huangcheng
 * @CreateTime: 2023-09-06  10:41
 * @Description:
 * @Version: 1.0
 */
@RestController
@Slf4j
public class SpringThreadPoolController {
    @Autowired
    private ThreadPoolService threadPoolService;

    @GetMapping("/testSpringSyncThread")
    public String testSpringSyncThread(){
        threadPoolService.testSpringSyncThread();
        return "testSpringSyncThread";
    }

    @GetMapping("/testSpringThreadPool")
    public String testSpringThreadPool(){
        threadPoolService.testSpringThreadPool();
        return "testSpringThreadPool";
    }

    @GetMapping("/defaultthread")
    public void testDefaultSpringThread(){
        threadPoolService.testDefaultSpringThread();
    }

}
